Skip to content

fix: 尊重 perf report 的自定义配置目录#1312

Open
liuCodeBoy wants to merge 1 commit into
claude-code-best:mainfrom
liuCodeBoy:fix/perf-report-config-dir
Open

fix: 尊重 perf report 的自定义配置目录#1312
liuCodeBoy wants to merge 1 commit into
claude-code-best:mainfrom
liuCodeBoy:fix/perf-report-config-dir

Conversation

@liuCodeBoy

@liuCodeBoy liuCodeBoy commented Jul 26, 2026

Copy link
Copy Markdown

问题

/perf-issue 的会话转录路径已经通过 getClaudeConfigHomeDir() 尊重 CLAUDE_CONFIG_DIR,但报告输出目录仍硬编码为 ~/.claude/perf-reports。这会破坏自定义配置目录的隔离,在 home 目录只读时也可能导致写入失败。

现有测试使用临时 CLAUDE_CONFIG_DIR;基线实现会将报告写到真实 home,因而有 5 个用例失败。

修改

将报告目录改为 <Claude config dir>/perf-reports,与转录、设置和其他配置数据使用相同的目录解析逻辑。未设置 CLAUDE_CONFIG_DIR 时仍保持原有的 ~/.claude/perf-reports 行为。

验证

  • bun test src/commands/perf-issue/__tests__/perf-issue.test.ts:16 pass / 0 fail
  • bun run typecheck 通过
  • bunx biome ci . 通过
  • bun run precheck:5984 pass / 10 skip / 0 fail
  • bun run build:vite 通过
  • git diff --check 通过

Summary by CodeRabbit

  • Bug Fixes
    • Updated the storage location for performance snapshot reports to use the configured Claude home directory, improving consistency across environments.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d67f62a5-3991-4eba-a538-44fa033d1adb

📥 Commits

Reviewing files that changed from the base of the PR and between 34b3dc9 and 6dac337.

📒 Files selected for processing (1)
  • src/commands/perf-issue/index.ts

📝 Walkthrough

Walkthrough

The perf issue command now writes snapshot reports to getClaudeConfigHomeDir()/perf-reports instead of the previous hardcoded path under the user home directory.

Changes

Perf report storage

Layer / File(s) Summary
Use Claude config home for reports
src/commands/perf-issue/index.ts
getPerfReportDir() now joins the Claude configuration home directory with perf-reports.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了 perf report 改为遵循自定义配置目录的主要变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant